﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;

namespace ZFB.Models.EntityConfig
{
    public class UsersConfig: IEntityTypeConfiguration<T_Users>
    {
        public void Configure(EntityTypeBuilder<T_Users> builder)
        {
            builder.ToTable("T_Users");
            builder.Property(e => e.PhoneNum).IsUnicode(false);
            builder.HasMany(e=>e.T_HouseAppointments).WithOne(e => e.T_Users).HasForeignKey(e => e.UserId).OnDelete(DeleteBehavior.Restrict);
        }
    }
}
